package com.boot.security.server.dao;

import java.util.List;
import java.util.Map;

import com.boot.security.server.model.AppReportlab;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.boot.security.server.model.AppReportexam;

@Mapper
public interface AppReportexamDao {

    @Select("select * from app_reportexam t where t.cardno = #{cardno}")
    AppReportexam getById(Long id);

    @Select("select * from app_reportexam t ")
    AppReportexam getByinfo(String  cardno);


    @Delete("delete from app_reportexam where id = #{id}")
    int delete(Long id);

    int update(AppReportexam appReportexam);
    
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into app_reportexam(deptid, hostcode, code, name, remark, descs, address, examdatetime, patientname, reqdoct, 临床诊断, reporter, chekcreporter, examclass, examsubclass, resultstatus, reqdatetime, description, impression, recommendation, exampara, cardno, cardtype, idcard, idcardtype, imgslt) values(#{deptid}, #{hostcode}, #{code}, #{name}, #{remark}, #{descs}, #{address}, #{examdatetime}, #{patientname}, #{reqdoct}, #{临床诊断}, #{reporter}, #{chekcreporter}, #{examclass}, #{examsubclass}, #{resultstatus}, #{reqdatetime}, #{description}, #{impression}, #{recommendation}, #{exampara}, #{cardno}, #{cardtype}, #{idcard}, #{idcardtype}, #{imgslt})")
    int save(AppReportexam appReportexam);
    
    int count(@Param("params") Map<String, Object> params);

    List<AppReportexam> list(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);


    @Select("select * from app_reportexam t" )
    List<AppReportexam> getBylist(@Param("cardno") String cardno  );
}
